home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / nwtp06 / tstconn3.pas < prev    next >
Pascal/Delphi Source File  |  1996-07-10  |  1KB  |  53 lines

  1. {$X+,V-,B-}
  2. program tstconn3;
  3.  
  4. { Testprogram for the nwConn unit / NwTP 0.6 API. (c) 1993, 1995, R.Spronk }
  5.  
  6. { Purpose: testing of nwConn calls }
  7.  
  8. { Tests the following nwConn functions:
  9.  
  10.   AttachToFileServer
  11.   AttachToFileServerWithAddress (called by AttachToFileServer)
  12.  
  13. }
  14.  
  15. uses nwMisc,nwConn;
  16.  
  17. Var connId,PrimConnId,t:byte;
  18.     serverName:string;
  19.  
  20. begin
  21. writeln('This program tests the AttachToFileServer call.');
  22. writeln('Can be tested in a multi-server network only.');
  23. getPrimaryConnectionId(PrimConnId);
  24. GetFileServerName(PrimConnId,serverName);
  25. writeln;
  26. writeln('Your primary server is ',serverName,' with connectionId ',PrimConnId);
  27.  
  28. writeln;
  29. writeln('ConnectionIDtable:');
  30. for t:=1 to 8
  31.  do If GetFileServerName(t,servername)
  32.        and (serverName<>'')
  33.      then writeln('ConnId: ',t:2,' Servername: ',serverName);
  34.  
  35. writeln;
  36. write('Enter name of new server (not in above list) to attach to:');
  37. readln(servername);
  38. IF NOT AttachToFileServer(serverName,connId)
  39.  then begin
  40.       writeln('AttachtoFileserver returned error: $',HexStr(nwConn.result,2));
  41.       if nwconn.result=$7D
  42.        then writeln(' (wrong servername or server unknown)');
  43.       halt(1);
  44.       end;
  45.  
  46. writeln;
  47. writeln('ConnectionIDtable:');
  48. for t:=1 to 8
  49.  do If GetFileServerName(t,servername)
  50.        and (serverName<>'')
  51.      then writeln('ConnId: ',t:2,' Servername: ',serverName);
  52.  
  53. end.